package club.easin.utils;

import java.util.ArrayList;
import java.util.List;

public class Tlist {
    private List<Tdata> TDATA=new ArrayList<Tdata>();

    public void add(Class<?> c,String methdName,Object... value ){
        Tdata tdata=new Tdata();
        tdata.setDaoName(c.getSimpleName());
        tdata.setmName(methdName);
        tdata.setValue(value);
        TDATA.add(tdata);
    }

    public  List getTdata(){
        return this.TDATA;
    }
    public int getDtatsize(){
        if(TDATA.size()==0) return 0;
        return TDATA.size();
    }

    //添加元素
    public void  add(Tlist map){
        if(map==null) return;
        List<Tdata> tdataList=map.getTdata();
        if(tdataList!=null) {
            TDATA.addAll(tdataList);
        }

    }

    //删除元素
    public void remove(String name){
        int size=0;
        while(size<TDATA.size()){
            if(name.equals(TDATA.get(size).getDaoName())){
                TDATA.remove(size);
            }else{
                size++;
            }
        }

    }

    //删除所有元素
    public void removeAll(){
        TDATA.clear();
    }
}
